#include "stdafx.h"
#include "Win32APIProvider.h"
#include "PromptDataSource.h"

using namespace System::Runtime::InteropServices;
using namespace Win32Utils;

Win32APIProvider::Win32APIProvider(void)
{
}

System::String^ Win32APIProvider::PromptDataSource(System::String^ InitialString)
{
	return LPWSTRToString(::PromptDataSource(StringToLPWSTR(InitialString)));
}

LPWSTR Win32APIProvider::StringToLPWSTR(System::String^ string)
{
	return (LPWSTR)(Marshal::StringToHGlobalUni(string).ToPointer()); 
}

System::String^ Win32APIProvider::LPWSTRToString(LPWSTR string)
{
	return Marshal::PtrToStringAuto(static_cast<System::IntPtr>(string));
}

